import "babel-polyfill";
import axios from 'axios';
var qs = require('qs');
axios.defaults.headers.post['Content-Type'] = 'application/json; charset=utf-8';

// let base = '/index.php?s=/shop';
// let base2 = '/index.php?s=/Shopapp';
let base = '/shop';
let base2 = '/shop';
export const login = params => { return axios.post(`${base2}/Login/login_yz`, JSON.stringify(params)).then(res => res.data); };
// export const login = params => { return axios.post(`${base}/user/login_yz`, JSON.stringify(params)).then(res => res.data); };
export const getMoneyFlow = params => { return axios.post(`${base}/pay/getMoneyFlow`, qs.stringify(params)).then(res => res.data); };
export const getImgMoneyFlow = params => { return axios.post(`${base}/pay/getImgMoneyFlow`, qs.stringify(params)).then(res => res.data); };
export const getCustomerOrders = params => { return axios.post(`${base}/Customer/getCustomerOrders`, qs.stringify(params)).then(res => res.data); };
export const getCustInfoById = params => { return axios.post(`${base}/Customer/getCustInfoById`, qs.stringify(params)).then(res => res.data); };
export const getScheduleById = params => { return axios.post(`${base}/Customer/getScheduleById`, qs.stringify(params)).then(res => res.data); };
export const getBatteryModel = params => { return axios.post(`${base}/Customer/getBatteryModel`, qs.stringify(params)).then(res => res.data); };
export const getCustQuestions= params => { return axios.post(`${base}/Customer/getCustQuestions`, qs.stringify(params)).then(res => res.data); };
export const upCustomerStatus= params => { return axios.post(`${base}/Customer/upCustomerStatus`, qs.stringify(params)).then(res => res.data); };
export const getOrderNums = params => { return axios.post(`${base}/Customer/getOrderNums`, qs.stringify(params)).then(res => res.data); };
export const creditComplaintInformationAdd = params => { return axios.post(`${base}/Customer/creditComplaintInformationAdd`, qs.stringify(params)).then(res => res.data); };

export const purchase = params => { return axios.post(`${base2}/index/purchase`, JSON.stringify(params)).then(res => res.data); };
export const GetTypeList = params => { return axios.post(`${base2}/Goods/GetTypeList`, JSON.stringify(params)).then(res => res.data); };
export const GetgoodsList = params => { return axios.post(`${base2}/Goods/GetgoodsList`, JSON.stringify(params)).then(res => res.data); };

export const payQrCode = params => { return axios.post(`${base2}/pay/payQrCode`, JSON.stringify(params)).then(res => res.data); };
export const getIsPaySm = params => { return axios.get(`${base2}/Order/getIsPaySm&`+params); };

// export const getfun = params => { return axios.get(`/Web`, { params: params }); };
